package com.wx.consumer.remote;

import feign.hystrix.FallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component
public class ClientServiceFallbackFactory implements FallbackFactory<HelloRemote> {

    private static final Logger logger = LoggerFactory.getLogger(ClientServiceFallbackFactory.class);

    @Override
    public HelloRemote create(Throwable throwable) {
        logger.info(throwable.getMessage());
        return new HelloRemoteServiceImpl();
    }
}
